Repository variables store values that can be used in all scripts recorded or run against an application version. Create repository variables if multiple scripts test the same data and the data changes based on the application conditions or inputs. Repository variables can be defined for each version in the application repository and shared between any scripts recorded or run against the version.
1. Select a version in the application repository and choose File > Properties.
The Properties dialog box opens.
2. Click the Repository Variables tab.
3. Click Add.
A new row is added to the variables list.
4. Enter a Variable Name.
Variable names must conform to the following identifier rules:
5. Enter a Description.
6. Click
in the Value Type column and select a variable Type.
7. Enter the Default Value. The value can be a text string, expression, value from an associated datasheet, or a variable.
If you selected List as the Value Type, enter the list values separated with a comma or click
to add the values. The first list value is the default value used when recording and running scripts. See Adding repository variable list values.
8. Select Replace to automatically replace all instances of the variable value with the variable name during recording.
The script and expected values for window and control properties are populated with the variable name instead of the variable value. You may want to select this option if you run scripts against different web servers so you do not have to make extensive modifications to scripts and the application repository.
For example, if you use the URLROOT variable, all instances of the variable value used during recording are replaced with %URLROOT% in the script and application repository. When scripts run, the variable is replaced with the value assigned for the playback session.
Note: Only select this option to replace unique values such as web server addresses. If the value is not unique, you may unintentionally replace the wrong value in scripts and the application repository, which can cause scripts to fail.
9. Select Prompt to prompt users to enter a variable value.
Note: If this option is selected, users are prompted to enter a variable value when the RunApp or ConnectToProcess statements run. If the repository variable is set in the script before these statements, users are not prompted and the value set in the script is used.
10. Click OK.
The variables are saved.